using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using hao_Dto.User;

namespace User.Service.Address
{
    /// <summary>
    /// 地址服务接口
    /// </summary>
    public interface IAddressService
    {
        /// <summary>
        /// 创建地址
        /// </summary>
        Task<AddressDto> CreateAddressAsync(Guid userId, CreateAddressDto createAddressDto);

        /// <summary>
        /// 更新地址
        /// </summary>
        Task<bool> UpdateAddressAsync(Guid addressId, Guid userId, UpdateAddressDto updateAddressDto);

        /// <summary>
        /// 删除地址
        /// </summary>
        Task<bool> DeleteAddressAsync(Guid addressId, Guid userId);

        /// <summary>
        /// 获取地址详情
        /// </summary>
        Task<AddressDto> GetAddressByIdAsync(Guid addressId, Guid userId);

        /// <summary>
        /// 获取用户地址列表
        /// </summary>
        Task<List<AddressDto>> GetUserAddressesAsync(Guid userId);

        /// <summary>
        /// 获取用户默认地址
        /// </summary>
        Task<AddressDto> GetDefaultAddressAsync(Guid userId);

        /// <summary>
        /// 设置默认地址
        /// </summary>
        Task<bool> SetDefaultAddressAsync(Guid userId, Guid addressId);

        /// <summary>
        /// 分页搜索地址
        /// </summary>
        Task<(List<AddressDto> addresses, int totalCount)> SearchAddressesAsync(AddressSearchDto searchDto);

        /// <summary>
        /// 批量删除地址
        /// </summary>
        Task<bool> BatchDeleteAddressesAsync(List<Guid> addressIds, Guid userId);

        /// <summary>
        /// 获取地址区域统计
        /// </summary>
        Task<List<AddressRegionStatsDto>> GetRegionStatsAsync();

        /// <summary>
        /// 验证地址数据
        /// </summary>
        Task<bool> ValidateAddressAsync(CreateAddressDto addressDto);

        /// <summary>
        /// 获取用户地址数量
        /// </summary>
        Task<int> GetUserAddressCountAsync(Guid userId);

        /// <summary>
        /// 导入地址数据
        /// </summary>
        Task<(int successCount, int failCount, List<string> errors)> ImportAddressesAsync(List<ImportAddressDto> addresses);

        /// <summary>
        /// 导出用户地址
        /// </summary>
        Task<List<AddressDto>> ExportUserAddressesAsync(Guid userId);
    }
}